package com.bbms.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * 借阅记录实体类
 * @author Administrator
 */
@Entity
@Table(name="bbms_borrow_record")
public class BorrowRecord implements Serializable{

	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;
	
	@Column(name="book_id")
	private Integer bookId;
	
	@Column(name="user_reader_id")
	private Integer readerId;
	
	@Column(name="user_manager_id")
	private Integer managerId;
	
	@Column(name="borrow_date")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date borrowDate;
	
	@Column(name="restore_date")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date restoreDate;
	
	@Column(name="renew_borrow_num")
	private int renewBorrowNum;
	
	@Column(name="status")
	private int status;

	public BorrowRecord() {
		super();
	}

	public BorrowRecord(int id, Integer bookId, Integer readerId, Integer managerId, Date borrowDate, Date restoreDate,
			int renewBorrowNum, int status) {
		super();
		this.id = id;
		this.bookId = bookId;
		this.readerId = readerId;
		this.managerId = managerId;
		this.borrowDate = borrowDate;
		this.restoreDate = restoreDate;
		this.renewBorrowNum = renewBorrowNum;
		this.status = status;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Integer getBookId() {
		return bookId;
	}

	public void setBookId(Integer bookId) {
		this.bookId = bookId;
	}

	public Integer getReaderId() {
		return readerId;
	}

	public void setReaderId(Integer readerId) {
		this.readerId = readerId;
	}

	public Integer getManagerId() {
		return managerId;
	}

	public void setManagerId(Integer managerId) {
		this.managerId = managerId;
	}

	public Date getBorrowDate() {
		return borrowDate;
	}

	public void setBorrowDate(Date borrowDate) {
		this.borrowDate = borrowDate;
	}

	public Date getRestoreDate() {
		return restoreDate;
	}

	public void setRestoreDate(Date restoreDate) {
		this.restoreDate = restoreDate;
	}

	public int getRenewBorrowNum() {
		return renewBorrowNum;
	}

	public void setRenewBorrowNum(int renewBorrowNum) {
		this.renewBorrowNum = renewBorrowNum;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "BorrowRecord [id=" + id + ", bookId=" + bookId + ", readerId=" + readerId + ", managerId=" + managerId
				+ ", borrowDate=" + borrowDate + ", restoreDate=" + restoreDate + ", renewBorrowNum=" + renewBorrowNum
				+ ", status=" + status + "]";
	}

	

}
